package cn.bonoon.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.bonoon.kernel.support.entities.AbstractPersistable;
@MappedSuperclass
public abstract class AbstractLogEntity extends AbstractPersistable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 4880983054965808555L;

	/** 记录下执行了该操作的用户的名（用户的登录名）。 */
	@Column(name = "C_USERNAME", length = 50)
	private String userName;
	
	/** 记录下执行了该操作的用户的名（用户的名称）。 */
	@Column(name = "C_LOGINNAME", length = 50)
	private String loginName;
	
	/** 记录下执行了该操作的用户的ID，操作日志里不要跟用户在实体上有任何的关联关系，
	 *  只里在这里存放一个用户的ID，可以指向某一个用户 */
	@Column(name = "C_CREATORID")
	private Long creatorId;

	/** 日志记录的时间，一定要有。 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_CREATEAT", nullable = false)
	private Date createAt;

	/** 记录下的操作内容 */
	@Column(name = "C_CONTENT", length = 2048)
	private String content;

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Date getCreateAt() {
		return createAt;
	}

	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Long getCreatorId() {
		return creatorId;
	}

	public void setCreatorId(Long creatorId) {
		this.creatorId = creatorId;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

}
